﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace prime_number
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入1-10万以内的数字");
            Console.Write("2 3 5 7 ");
            int intnum=4;
            for (int i = 9; i <= 100000; i=i+2)
            {
                if (i% 2 !=0 && i % 3!=0 && i % 5!=0)
                {
                    Console.Write(i);
                    Console.Write(" ");

                    intnum++ ;
                    if (intnum % 20==0)
                    {
                        Console.WriteLine("");
                    }
                }
               
            }
            Console.WriteLine("请按任意键退出");
            Console.ReadKey(); 
        }
    }
}
